#include "BaseComponentPlugin.h"

#include "Expand/PluginsManager.h"
#include "Managers/GameManager.h"
#include "Managers/ComponentsManager.h"

// #include "ComponentVitalStatsBase.h"
#include "ComponentBoat.h"
// #include "ComponentBodyBase.h"
#include "ComponentLoot.h"
#include "ComponentAutoJump.h"
// #include "ComponentHumanModelBase.h"
#include "ComponentLocomotionBase.h"

#include "GameSingleton.h"
#include "Log.h"

namespace PocketSurvival
{
    BaseComponentPlugin::BaseComponentPlugin()
    {
    }

    const std::string &BaseComponentPlugin::getPluginName()
    {
        static const std::string pluginName = "原版组件插件";
        return pluginName;
    }

    const std::string &BaseComponentPlugin::getIntroduce()
    {
        static const std::string introduce = "这只是一个原版的组件测试插件";
        return introduce;
    }

    uint32_t BaseComponentPlugin::getUseAuthLevel()
    {
        return 100;
    }

    AuthDisplayType BaseComponentPlugin::getDisplayType()
    {
        return AuthDisplayType::Authority;
    }

    void BaseComponentPlugin::processCmd(ChatObj &chatObj, std::vector<std::string> &cmdDataVec) {}

    void BaseComponentPlugin::load()
    {
        GameSingleton::componentsManager->emplaceComponent<ComponentBoat>();
        GameSingleton::componentsManager->emplaceComponent<ComponentLoot>();
        GameSingleton::componentsManager->emplaceComponent<ComponentAutoJump>();
        // GameSingleton::componentsManager->replcaeOrEmplaceComponent<ComponentLocomotion, ComponentLocomotionBase>();
    }

} // namespace PocketSurvival


using namespace PocketSurvival;

extern "C" void initialize()
{
    GameSingleton::pluginsManager->registerPlugin<BaseComponentPlugin>();
    Log::Info("成功加载 BaseComponentPlugin 插件");
}